package com.arch.flink.biz.orderdemo;

import lombok.Data;

/**
 * @author pizhihui
 * @date 2020-12-12
 */
@Data
public class OrderDetailBean {

    private Long orderId;
    private String name;
    private Double price;


    public static OrderDetailBean string2OrderDetail(String line) {
        if (null == line || line.length() <= 0) {
            return null;
        }
        OrderDetailBean orderDetailBean = new OrderDetailBean();
        String[] split = line.split(",");
        orderDetailBean.setOrderId(Long.parseLong(split[0]));
        orderDetailBean.setName(split[1]);
        orderDetailBean.setPrice(Double.parseDouble(split[2]));
        return orderDetailBean;
    }

}
